package com.ruoyi.spicfz.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.spicfz.mapper.ShareholderMapper;
import com.ruoyi.spicfz.domain.Shareholder;
import com.ruoyi.spicfz.service.IShareholderService;
import com.ruoyi.common.core.text.Convert;

/**
 * 股东信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-08-30
 */
@Service
public class ShareholderServiceImpl implements IShareholderService 
{
    @Autowired
    private ShareholderMapper shareholderMapper;

    /**
     * 查询股东信息
     * 
     * @param shareholderId 股东信息ID
     * @return 股东信息
     */
    @Override
    public Shareholder selectShareholderById(Long shareholderId)
    {
        return shareholderMapper.selectShareholderById(shareholderId);
    }

    /**
     * 查询股东信息列表
     * 
     * @param shareholder 股东信息
     * @return 股东信息
     */
    @Override
    public List<Shareholder> selectShareholderList(Shareholder shareholder)
    {
        return shareholderMapper.selectShareholderList(shareholder);
    }

    /**
     * 新增股东信息
     * 
     * @param shareholder 股东信息
     * @return 结果
     */
    @Override
    public int insertShareholder(Shareholder shareholder)
    {
        shareholder.setCreateTime(DateUtils.getNowDate());
        return shareholderMapper.insertShareholder(shareholder);
    }

    /**
     * 修改股东信息
     * 
     * @param shareholder 股东信息
     * @return 结果
     */
    @Override
    public int updateShareholder(Shareholder shareholder)
    {
        shareholder.setUpdateTime(DateUtils.getNowDate());
        return shareholderMapper.updateShareholder(shareholder);
    }

    /**
     * 删除股东信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteShareholderByIds(String ids)
    {
        return shareholderMapper.deleteShareholderByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除股东信息信息
     * 
     * @param shareholderId 股东信息ID
     * @return 结果
     */
    @Override
    public int deleteShareholderById(Long shareholderId)
    {
        return shareholderMapper.deleteShareholderById(shareholderId);
    }
}
